!function(e){"use strict";let t=!1,i=wpcSetVars.postTypesTaxList,l=wpcSetVars.numFieldNoTaxes,n=wpcSetVars.numFieldAttrs;function s(e){e.fadeTo(100,0,function(){e.slideUp(100,function(){e.remove()})})}function a(t,i){let l=e("#"+t);void 0!==l&&l.before('<div class="wpc-field-notice wpc-field-notice-error"><p>'+i+"</p></div>")}function p(e){let t=e.find(".wpc-filter-head"),i=t.next(".wpc-filter-body");t.addClass("wpc-opened"),i.slideDown({duration:200,complete:function(){i.addClass("wpc-opened")}})}function c(t){t.find(".wpc-filter-additional-fields").slideUp({duration:200,complete:function(){e(this).removeClass("wpc-opened")}})}function d(t,i){var l,n;let s="",a,p,c,d=(l=e("."+t.attr("class")),n=t,a=[],p="",c=["post_meta","post_meta_num","post_meta_exists","tax_numeric"],l.length>0&&(l.each(function(){p=e(this).val(),!(e(this).attr("id")==n.attr("id")||c.includes(p))&&p&&a.push(p)}),a)),o=function t(){if(void 0!==wpcSetVars.postTypesTaxList){let i=e("#wpc_set_fields-post_type").val(),l=[],n=[];return void 0!==wpcSetVars.postTypesTaxList[i]&&e.each(wpcSetVars.postTypesTaxList[i],function(e,t){l.push(t.name)}),e.each(wpcSetVars.postTypesTaxList,function(t,s){t!==i&&e.each(s,function(e,t){!1===l.includes(t.name)&&n.push(t.name)})}),n}return[]}();return t.find("option").each(function(){("post_meta_exists"!==(s=e(this).val())||!(wpcSetVars.filtersPro<1))&&("tax_numeric"!==s||!(wpcSetVars.filtersPro<1))&&(d.includes(s)||o.includes(s)?e(this).attr("disabled","disabled"):e(this).removeAttr("disabled"))}),"disabled"!==t.find("option:selected").attr("disabled")||i||t.find("option:not([disabled]):first").prop("selected",!0).trigger("change"),!0}function o(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid");i=f(i);let n=e("#wpc-filter-id-"+l+" .wpc-form-fields-table");wpcSetVars.swatchesTaxonomies.includes(i)?n.addClass("taxonomy-has-swatches"):n.removeClass("taxonomy-has-swatches"),wpcSetVars.brandEntities.includes(i)?n.addClass("wpc-filter-has-brands"):n.removeClass("wpc-filter-has-brands")}function r(t){let i=0;e(".wpc-new-filter-item .wpc-field-entity").each(function(){let t=e(this),l=!1;e(this).attr("id")==t.attr("id")&&(l=!0),setTimeout(function(){d(t,l)},i),i+=100})}function f(e){let t=e;return e.includes("taxonomy_")?"taxonomy_"===e.slice(0,9)&&(t=e.slice(9)):e.includes("author_")&&"author_"===e.slice(0,7)&&(t=e.slice(7)),t}function w(t){if(wpcSetVars.filtersPro<1||""===t)return!0;s(e(".wpc-field-notice"));let i=e(".wpc_set_fields-wp_filter_query-wrap").children(".spinner"),l=e("#wpc_set_fields-post_type").val(),n={};n._wpnonce=e("#wpc_set_nonce").val(),n.wpPageType=e("#wpc_set_fields-wp_page_type").val(),n.postType=l,n.postId=e("#post_ID").val(),n.action="wpc_get_wp_queries",e.ajax({method:"POST",data:n,url:t,dataType:"html",beforeSend:function(){i.addClass("is-active"),e(".wpc-location-preview").attr("href",t)},complete:function(){i.removeClass("is-active")},success:function(t){let i=e(t).find("#wpc_set_fields-wp_filter_query"),l=e(t).find("#wpc_query_vars");""!==i&&i.length>0&&e("#"+wpcSetVars.wPQuerySelectId).replaceWith(i),l.length>0&&e("#wpc_query_vars").replaceWith(l)},error:function(e){}})}function u(t){let i=e(".wpc_set_fields-post_name-wrap").children(".spinner");i.addClass("is-active"),s(e(".wpc-field-notice"));let l=e("#wpc_set_fields-post_type").val(),n={};n._wpnonce=e("#wpc_set_nonce").val(),n.wpPageType=t,n.postType=l,n.postId=e("#post_ID").val(),wp.ajax.post("wpc-get-set-location-terms",n).always(function(){i.removeClass("is-active")}).done(function(t){let i=e(t.html).find("#wpc_set_fields-post_name");e("#wpc_set_fields-post_name").replaceWith(i);let l=e("option:selected",e("#wpc_set_fields-post_name")).data("link");void 0!==l&&w(l)}).fail(function(e){void 0!==e&&a("wpc_set_fields-post_name",e.message)})}function h(e,t){let i;i=e.val(),t.text(i)}function m(){e(".wpc-filter-item").each(function(t,i){var l=t+1;e(i).find(".wpc-menu-order-field").attr("value",l),e(i).find(".wpc-filter-order").attr("title",l)})}function v(){e(".wpc-filter-item:not(.wpc-filter-not-listed)").length>0?e(".wpc-no-filters").hide():!1===e(".wpc-filter-not-listed").hasClass("wpc-opened")&&e(".wpc-no-filters").show()}function b(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid"),n="";i.startsWith("taxonomy_pa_")&&(n=" taxonomy-product-attribute"),-1!==i.indexOf("taxonomy")&&(i="taxonomy"),e("#wpc-filter-id-"+l+" .wpc-form-fields-table").attr("class","wpc-form-fields-table wpc-filter-"+i+n)}function y(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid");if(void 0!==wpcSetVars.filterSlugs[i]){let n=wpcSetVars.filterSlugs[i];e("#wpc_filter_fields-"+l+"-slug").val(n).attr("readonly","readonly").trigger("input")}else e("#wpc_filter_fields-"+l+"-slug").val("").removeAttr("readonly").trigger("input")}function g(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid");i.includes("taxonomy_pa")?(e("#wpc_filter_fields-"+l+'-orderby option[value="menuasc"]').removeAttr("disabled"),e("#wpc_filter_fields-"+l+'-orderby option[value="menudesc"]').removeAttr("disabled")):(e("#wpc_filter_fields-"+l+'-orderby option[value="menuasc"]').attr("disabled","disabled"),e("#wpc_filter_fields-"+l+'-orderby option[value="menudesc"]').attr("disabled","disabled"))}function x(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid");"post_meta_num"===i||"tax_numeric"===i?(e("#wpc_filter_fields-"+l+'-view option:not([value="range"])').attr("disabled","disabled"),e("#wpc_filter_fields-"+l+'-view option[value="range"]').removeAttr("disabled").prop("selected",!0),e("#wpc_filter_fields-"+l+"-view").trigger("change")):(e("#wpc_filter_fields-"+l+"-view option").removeAttr("disabled"),e("#wpc_filter_fields-"+l+"-view option:not([disabled]):first").prop("selected",!0),e("#wpc_filter_fields-"+l+'-view option[value="range"]').attr("disabled","disabled"),e("#wpc_filter_fields-"+l+"-view").trigger("change"))}function $(t){let i=t.val(),l=t.parents(".wpc-filter-item");-1!==i.indexOf("taxonomy")?e.each(wpcSetVars.postTypesTaxList,function(t,n){e.each(n,function(e,t){t.name===i&&(t.hierarchical?l.find(".wpc-form-fields-table").addClass("taxonomy-hierarchical"):l.find(".wpc-form-fields-table").removeClass("taxonomy-hierarchical"))})}):l.find(".wpc-form-fields-table").removeClass("taxonomy-hierarchical")}function C(t){let i=t.val(),l=t.parents(".wpc-filter-item").data("fid");if("post_meta"===i||"post_meta_num"===i||"post_meta_exists"===i){let s=e("#wpc_filter_fields-"+l+"-e_name");if("select"===s.prop("tagName").toLowerCase()){let a=e("<input>");e("#wpc_set_fields-post_type").val(),a.attr("class",s.attr("class")).attr("type","text").attr("name",s.attr("name")).attr("id",s.attr("id")),s.val(""),s.removeAttr("readonly"),s.replaceWith(a),a.parents(".wpc-field-ename-tr").show()}else s.val(""),s.parents(".wpc-field-ename-tr").show();e("#wpc-filter-id-"+l+" .wpc-field-ename-tr p.wpc-field-description").text(n.post_meta_num.description),e("#wpc-filter-id-"+l+" .wpc-field-ename-tr label.wpc-filter-label span.wpc-label-text").text(n.post_meta_num.label),e("#wpc-filter-id-"+l+" .wpc-field-ename-tr p.description").css("visibility","visible")}else if("tax_numeric"===i){let p=e("#wpc_filter_fields-"+l+"-e_name"),c=e("#wpc_set_fields-post_type").val();if("input"===p.prop("tagName").toLowerCase()){let d=e("<select>");d.attr("class",p.attr("class")).attr("name",p.attr("name")).attr("id",p.attr("id")),p.removeAttr("readonly"),p.replaceWith(d),S(d,c),d.parents(".wpc-field-ename-tr").show()}else S(p,c),p.parents(".wpc-field-ename-tr").show();e("#wpc-filter-id-"+l+" .wpc-field-ename-tr p.wpc-field-description").text(n.tax_numeric.description),e("#wpc-filter-id-"+l+" .wpc-field-ename-tr label.wpc-filter-label span.wpc-label-text").text(n.tax_numeric.label),e("#wpc-filter-id-"+l+" .wpc-field-ename-tr p.description").css("visibility","hidden")}else e("#wpc_filter_fields-"+l+"-e_name").parents(".wpc-field-ename-tr").hide();"post_meta_num"===i||"tax_numeric"===i?e("#wpc_filter_fields-"+l+"-in_path").prop("checked",!1):e("#wpc_filter_fields-"+l+"-in_path").prop("checked",!0)}function _(t,i,l){s(e(".wpc-field-notice"));let n={},a=e("#wpc_filter_fields-"+i+"-exclude");n._wpnonce=e("#wpc_set_nonce").val(),n.fid=i,n.entity=t,void 0!==l&&(n.ename=l);let p=a.parent(".wpc-after-spinner-container").prev(".spinner");p.addClass("is-active"),wp.ajax.post("wpc-load-exclude-terms",n).always(function(){p.removeClass("is-active")}).done(function(e){void 0!==e.fid&&(a.select2("destroy"),a.html(""),a.select2({width:"100%",placeholder:wpcSetVars.excludePlaceholder,data:e.terms,disabled:!1}))}).fail(function(e){})}function k(e,t,i){var l=(t=t.replace("[]","[%%index%%]")).match(/([^\[\]])+/g);if(l)for(var n=l.length,s=e,a=0;a<n;a++){var p=String(l[a]);a==n-1?"%%index%%"===p?s.push(i):s[p]=i:("%%index%%"===l[a+1]?T(s[p])||(s[p]=[]):A(s[p])||(s[p]={}),s=s[p])}}function T(e){return Array.isArray(e)}function A(e){return"object"==typeof e}function S(t,n){t.find("option").remove().end(),n in i?e(i[n]).each(function(){t.append(e("<option>").attr("value",this.name).text(this.label))}):t.append(e("<option>").attr("value",-1).text(l))}e(document).ready(function(){e("form#post").on("submit",function(i){var l,n;s(e(".wpc-field-notice")),s(e("#message"));let c,d;if(d=(c=(l=e(".wpc-filter-item")).find(".wpc-filter-head")).next(".wpc-filter-body"),c.removeClass("wpc-opened"),d.slideUp({duration:200,complete:function(){d.removeClass("wpc-opened")}}),!t){i.preventDefault();let o,r;n=e(this),o=e("#publishing-action .spinner"),r={},o.addClass("is-active"),r.validateData=function e(t){for(var i={},l=t.find("select, textarea, input").serializeArray(),n=0;n<l.length;n++)k(i,l[n].name,l[n].value);return i}(n),wp.ajax.post("wpc-validate-filters",r).always(function(){o.removeClass("is-active")}).done(function(e){t=!0,n.submit()}).fail(function(t){var i;let l=[],n="",s,c,d;void 0!==t.errors&&(e.each(t.errors,function(t,i){void 0!==i.id?(a(i.id,i.message),n=e("#"+i.id).parents(".wpc-filter-item"),p(n),e("#"+i.id).parents(".wpc-filter-additional-fields").length>0&&function t(i){i.find(".wpc-filter-additional-fields").slideDown({duration:200,complete:function(){e(this).addClass("wpc-opened")}})}(n)):l.push(i.message)}),l.length<1&&l.push("Error: Set was not saved."),i=l,s=e("form#post"),c="",e.each(i,function(e,t){c+="<p>"+t+"</p>"}),d='<div id="message" class="error notice notice-error is-dismissible">'+c+'<button type="button" class="notice-dismiss"><span class="screen-reader-text">Dismiss this notice.</span></button></div>',void 0!==s&&(e("#message").length>0&&e("#message").remove(),s.before(d)))})}}),e(".wpc-add-filter").on("click",function(t){t.preventDefault();let i=e("#wpc-new-filter").html(),l=e(i),n="wpc_new_id",s=uniqId("filter_"),a=function(e,t){return t.replace(n,s)},c=e("#wpc-filters-list");l.find('[id*="'+n+'"]').attr("id",a),l.find('[for*="'+n+'"]').attr("for",a),l.find('[name*="'+n+'"]').attr("name",a),l.data("fid",s),l.attr("id","wpc-filter-id-"+s);let r=e(".wpc-filter-item").last();if(r.hasClass("wpc-filter-not-listed")){let w=r.prev(".wpc-filter-item");w.hasClass("wpc-filter-not-listed")?w.before(l):r.before(l)}else c.append(l);let u=l.find(".wpc-field-entity"),h,_,k,T,A,S,P;y(u),C(u),b(u),x(u),g(u),d(u),$(u),o(u),l.find(".wpc-field-exclude").select2({width:"100%",placeholder:wpcSetVars.excludePlaceholder}),1===e(".wpc-filter-item:not(.wpc-filter-not-listed)").length&&u.trigger("change"),e(".wpc-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200,keepAlive:!0,maxWidth:"220px"}),p(l),m(),v(),h={},_=0,k="",T="",A=!1,S=!1,P=!1,e(".wpc-filter-item:not(.wpc-filter-not-listed)").each(function(t,i){_=e(this).data("fid"),(k=e("#wpc_filter_fields-"+_+"-label").val())||(k=wpcSetVars.newFilter),T=e("#wpc_filter_fields-"+_+"-entity").val(),h[_]={id:_.toString(),title:k,ename:T}}),!(Object.keys(h).length<2)&&e.each(h,function(t,i){(A=e("#wpc_filter_fields-"+i.id+"-parent_filter > option[value='no']")).length>0&&(A.val("-1"),A.text(wpcSetVars.selectFilter)),e.each(h,function(t,l){i.id!==t&&(S=e("#wpc_filter_fields-"+i.id+"-parent_filter > option[value='"+t+"']")).length<1&&(P=e("<option>",{value:t,text:l.title+" ("+f(l.ename)+")"}),("post_meta_num"===l.ename||"tax_numeric"===l.ename)&&P.attr("disabled","disabled"),e("#wpc_filter_fields-"+i.id+"-parent_filter").append(P))})})}),e(".wpc-form-fields-table:not(.wpc-filter-tax_numeric) .wpc-field-exclude, .wpc-form-fields-table:not(.wpc-filter-post_meta_num) .wpc-field-exclude, .wpc-form-fields-table:not(.wpc-filter-post_meta_exists) .wpc-field-exclude").select2({width:"100%",placeholder:wpcSetVars.excludePlaceholder}),e("body").on("click",".notice-dismiss",function(t){t.preventDefault(),s(e("#message"))}),e("body").on("click",".wpc-button-link-delete",function(t){t.preventDefault(),e(this).parents(".wpc-filter-label-td").next(".wpc-filter-field-td").children(".wpc-filter-delete-wrapper").css("visibility","visible")}),e("body").on("click",".wpc-filter-delete-cancel",function(t){t.preventDefault(),s(e(".wpc-field-notice")),e(this).parents(".wpc-filter-delete-wrapper").css("visibility","hidden")}),e("body").on("click",".wpc-done-action",function(t){e(this).parents(".wpc-filter-body").slideToggle(200).toggleClass("wpc-opened").children(".wpc-filter-additional-fields").removeClass("wpc-additional-opened").hide(),e(this).parents(".wpc-filter-body").prev(".wpc-filter-head").toggleClass("wpc-opened"),e(this).parents(".wpc-filter-field-td").next(".wpc-filter-field-td").find(".wpc-filter-delete-wrapper").css("visibility","hidden")}),e("body").on("click",".wpc-advice-head",function(t){e(this).toggleClass("wpc-opened")}),e("body").on("click",".wpc-title-action",function(t){let i=e(this).parent(".wpc-filter-head"),l=i.next(".wpc-filter-body");i.toggleClass("wpc-opened"),l.slideToggle(200).toggleClass("wpc-opened").children(".wpc-filter-additional-fields").removeClass("wpc-additional-opened").hide(),l.find(".wpc-filter-delete-wrapper").css("visibility","hidden");let n=l.find(".wpc-more-options-toggle");n.hasClass("wpc-opened")&&n.trigger("click")}),e("body").on("click",".wpc-more-options-toggle",function(t){t.preventDefault();e(this).text()===wpcSetVars.moreOptions?e(this).text(wpcSetVars.lessOptions):e(this).text(wpcSetVars.moreOptions),e(this).toggleClass("wpc-opened"),e(this).parents(".wpc-filter-body").find(".wpc-filter-additional-fields").slideToggle(200).toggleClass("wpc-additional-opened")}),e("body").on("change","select.wpc-field-ename",function(t){let i=0;e(e(".wpc-new-filter-item select.wpc-field-ename").get().reverse()).each(function(){let t=e(this);setTimeout(function(){d(t,!1)},i),i+=100})}),e("body").on("change",".wpc-field-entity",function(t){var i;let l=e(this),n="",s,a;r(l),y(l),C(l),s=(i=l).val(),a=i.parents(".wpc-filter-item").data("fid"),"author_author"===s||"post_meta_exists"===s?(e("#wpc_filter_fields-"+a+'-logic option[value="and"]').attr("disabled","disabled"),e("#wpc_filter_fields-"+a+'-logic option[value="or"]').prop("selected",!0)):"post_meta_num"===s||"tax_numeric"===s?(e("#wpc_filter_fields-"+a+'-logic option[value="or"]').attr("disabled","disabled"),e("#wpc_filter_fields-"+a+'-logic option[value="and"]').prop("selected",!0)):(e("#wpc_filter_fields-"+a+'-logic option[value="and"]').removeAttr("disabled"),e("#wpc_filter_fields-"+a+'-logic option[value="or"]').removeAttr("disabled")),b(l),x(l),g(l),$(l),o(l);let p=e(this).val(),c=e(this).parents(".wpc-filter-item").data("fid");("tax_numeric"===p&&e("#wpc_filter_fields-"+c+"-e_name").trigger("change"),"tax_numeric"===p||"post_meta"===p||"post_meta_num"===p||"post_meta_exists"===p)?e("#wpc_filter_fields-"+c+"-exclude").select2({disabled:!0,width:"100%"}):_(p,c);let d=e(this).find("option:selected").text();e(this).parents(".wpc-filter-item").find(".wpc-filter-head li.wpc-filter-entity").text(d),(n=e("#wpc_filter_fields-"+c+"-label").val())||(n=wpcSetVars.newFilter),e(".wpc-field-parent-filter option[value='"+c+"'").each(function(t,i){e(this).text(n+" ("+f(p)+")"),"post_meta_num"===p||"tax_numeric"===p?e(this).attr("disabled","disabled"):e(this).removeAttr("disabled")})}),e("body").on("input change",".wpc-field-ename",function(){let t=e(this).val(),i=e(this).parents(".wpc-filter-item").data("fid"),l=e("#wpc_filter_fields-"+i+"-entity").val(),n="",s=wpcSetVars.filterSlugs;void 0!==s[n="post_meta_num"===l?"post_meta_num_"+t:"tax_numeric"===l?"tax_numeric_"+t:"post_meta_exists"===l?"post_meta_exists_"+t:"post_meta_"+t]?(e("#wpc_filter_fields-"+i+"-slug").val(s[n]).trigger("input"),"post_meta_num"!==l&&"tax_numeric"!==l&&_(l,i,t)):(e("#wpc_filter_fields-"+i+"-slug").val("").trigger("input"),e("#wpc_filter_fields-"+i+"-exclude").select2({disabled:!0,width:"100%"}))}),e("body").on("input",".wpc-field-value-step",function(){e(this).val(e(this).val().replace(/,/g,".")),e(this).val(e(this).val().replace(/[^\d\.]/g,""))}),e("body").on("input keydown","#wpc_set_fields-apply_button_text",function(){let t=e("#wpc-filter-id-apply-button").find(".wpc-button-apply");h(e(this),t)}),e("body").on("input keydown","#wpc_set_fields-reset_button_text",function(){let t=e("#wpc-filter-id-apply-button").find(".wpc-button-reset");h(e(this),t)}),e("body").on("input keydown","#wpc_set_fields-search_field_placeholder",function(){e("#wpc-filter-id-search-field").find(".wpc-text-input-search").attr("placeholder",e(this).val())}),e("body").on("input keydown","#wpc_set_fields-search_field_label",function(){let t=e("#wpc-filter-id-search-field").find(".wpc-filter-label");h(e(this),t)}),e("body").on("input keydown",".wpc-field-slug",function(){let t=e(this).parents(".wpc-filter-item").find(".wpc-filter-head li.wpc-filter-slug");h(e(this),t)}),e("body").on("input keydown",".wpc-field-label",function(){let t=e(this).parents(".wpc-filter-item").find(".wpc-filter-head li.wpc-filter-label");h(e(this),t);let i=e(this).parents(".wpc-filter-item").data("fid"),l=e("#wpc_filter_fields-"+i+"-entity").val();l=f(l);let n=e(this).val();e(".wpc-field-parent-filter option[value='"+i+"'").each(function(t,i){e(this).text(n+" ("+l+")")})}),e("body").on("change",".wpc-field-view",function(){let t=e(this).find("option:selected").text(),i=e(this).find("option:selected").val(),l=e(this).parents(".wpc-filter-item"),n;l.find(".wpc-filter-head li.wpc-filter-view").text(t),["checkboxes","radio","labels"].includes(i)?(l.find(".wpc-field-search-tr").show(),l.find(".wpc-field-more-less-tr").show()):(l.find(".wpc-field-search-tr").hide(),l.find(".wpc-field-more-less-tr").hide()),"checkboxes"===i?l.find(".wpc-form-fields-table").addClass("wpc-view-checkboxes"):l.find(".wpc-form-fields-table").removeClass("wpc-view-checkboxes")}),e(".wpc-filter-set-wrapper .wpc-filters-list").sortable({items:"> div.wpc-filter-item",delay:150,placeholder:"wpc-filter-item-shadow",refreshPositions:!0,cursor:"move",handle:".wpc-filter-order",axis:"y",update:function(e,t){m()},start:function(t,i){e(this);var l=i.item.children(".wpc-filter-head"),n=i.item.children(".wpc-filter-body");n.hasClass("wpc-opened")&&(n.removeClass("wpc-opened").hide(),l.removeClass("wpc-opened"),e(this).sortable("refreshPositions")),e(".wpc-filter-item-shadow").css("min-height",l.height()+"px")}}),e(".wpc-filter-set-wrapper .wpc-filters-list").keydown(function(e){65==e.keyCode&&(e.ctrlKey||e.metaKey)&&e.target.select()}),e(".wpc-filters-list").disableSelection(),e("body").on("click",".wpc-filter-delete",function(){s(e(".wpc-field-notice"));let t=e(this).prev(".spinner");t.addClass("is-active");let i={};i._wpnonce=e("#wpc_set_nonce").val(),i.fid=e(this).data("fid"),"wpc_new_id"===i.fid&&e(this).parents(".wpc-filter-item").slideUp({duration:200,complete:function(){e(this).remove(),m(),v()}});let l;(function t(i){let l=!1;e(".wpc-field-parent-filter option[value='"+i+"'").each(function(t,i){let n=(l=e(this)).parents("select");l.is(":selected")&&n.val(n.find("option:first").val()),l.remove(),1===n.find("option").length&&((l=n.find("option:first")).val("no"),l.text(wpcSetVars.addFilter),n.val("no"))})})(e(this).parents(".wpc-filter-item").data("fid")),wp.ajax.post("wpc-delete-filter",i).always(function(){t.removeClass("is-active")}).done(function(t){void 0!==t&&void 0!==t.fid&&e("#wpc-filter-id-"+t.fid).slideUp({duration:200,complete:function(){e(this).remove(),m(),v(),r()}})}).fail(function(e){void 0!==e&&a("wpc-filter-delete-wrapper-"+e.fid,e.message)})}),e("body").on("change","#wpc_set_fields-post_type",function(){let t=e(this).val();if(e("#wpc-filters-list").attr("data-posttype",t),wpcSetVars.filtersPro<1)return!0;d(e(".wpc-new-filter-item .wpc-field-entity")),s(e(".wpc-field-notice"));let i=e("#wpc_set_fields-wp_page_type").val();void 0!==i&&u(i);let l=e("select.wpc-field-ename");l.length>0&&S(l,t)}),e("body").on("change","#wpc_set_fields-wp_page_type",function(){u(e(this).val())}),e("body").on("change","#wpc_set_fields-apply_button_page_type",function(){var t;let i,l,n;t=e(this).val(),i=e(".wpc_set_fields-apply_button_post_name-wrap").children(".spinner"),i.addClass("is-active"),s(e(".wpc-field-notice")),l=e("#wpc_set_fields-post_type").val(),n={},n._wpnonce=e("#wpc_set_nonce").val(),n.wpPageType=t,n.postType=l,n.postId=e("#post_ID").val(),n.fieldKey="apply_button_post_name",wp.ajax.post("wpc-get-set-location-terms",n).always(function(){i.removeClass("is-active")}).done(function(t){let i=e(t.html).find("#wpc_set_fields-apply_button_post_name");e("#wpc_set_fields-apply_button_post_name").replaceWith(i)}).fail(function(e){void 0!==e&&a("wpc_set_fields-apply_button_post_name",e.message)})}),e("body").on("change","#wpc_set_fields-post_name",function(t){let i=e("option:selected",this).data("link");void 0!==i&&w(i)}),e("body").on("change",".wpc-field-parent-filter",function(){let t=e(this).val(),i=e(this).parents(".wpc-filter-item").data("fid"),l=e("#wpc-filter-id-"+i+" .wpc-field-hide-until-parent-tr");["no","-1"].includes(t)?l.removeClass("wpc-opened"):l.addClass("wpc-opened")}),e("body").on("click","#wpc_set_fields-use_apply_button",function(){e(this).prop("checked")?(e("#wpc-filter-id-apply-button").addClass("wpc-opened"),e(".wpc-field-apply-button-text-tr").addClass("wpc-opened"),e(".wpc-field-apply-button-page-type-tr").addClass("wpc-opened"),e(".wpc-field-reset-button-text-tr").addClass("wpc-opened"),e(".wpc-no-filters").hide()):(e("#wpc-filter-id-apply-button").removeClass("wpc-opened"),e(".wpc-field-apply-button-text-tr").removeClass("wpc-opened"),e(".wpc-field-apply-button-page-type-tr").removeClass("wpc-opened"),e(".wpc-field-reset-button-text-tr").removeClass("wpc-opened"),e(".wpc-filter-item:visible").length<1&&e(".wpc-no-filters").show())}),e("body").on("click","#wpc_set_fields-use_search_field",function(){e(this).prop("checked")?(e("#wpc-filter-id-search-field").addClass("wpc-opened"),e(".wpc-search-field-placeholder-tr").addClass("wpc-opened"),e(".wpc-search-field-label-tr").addClass("wpc-opened"),e(".wpc-no-filters").hide()):(e("#wpc-filter-id-search-field").removeClass("wpc-opened"),e(".wpc-search-field-placeholder-tr").removeClass("wpc-opened"),e(".wpc-search-field-label-tr").removeClass("wpc-opened"),e(".wpc-filter-item:visible").length<1&&e(".wpc-no-filters").show())});let i=e("option:selected",e("#wpc_set_fields-post_name")).data("link");void 0!==i&&i&&w(i)})}(jQuery);function uniqId(e,t){void 0===e&&(e="");var i,l=function(e,t){return t<(e=parseInt(e,10).toString(16)).length?e.slice(e.length-t):t>e.length?Array(1+(t-e.length)).join("0")+e:e},n="undefined"!=typeof window?window:global;n.$locutus=n.$locutus||{};var s=n.$locutus;return s.php=s.php||{},s.php.uniqidSeed||(s.php.uniqidSeed=Math.floor(123456789*Math.random())),s.php.uniqidSeed++,i=e,i+=l(parseInt(new Date().getTime()/1e3,10),8),i+=l(s.php.uniqidSeed,5),t&&(i+=(10*Math.random()).toFixed(8).toString()),i}